﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace Dispatch.Receive
{
    /// <summary>
    /// 测试设备的代码
    /// </summary>
    internal class DemoDevice : IDeviceEvent 
    {
        public byte[] AgvError(int DockNum)
        {
            throw new NotImplementedException();
        }

        public byte[] AgvHasLeaved(int DockNum)
        {
            throw new NotImplementedException();
        }

        public byte[] AgvIsArrived(int DockNum)
        {
            throw new NotImplementedException();
        }

        public byte[] AgvRefuseTrans(int DockNum, bool Up, bool Down)
        {
            throw new NotImplementedException();
        }

        public byte[] AgvTransOk(int DockNum, bool Up, bool Down)
        {
            throw new NotImplementedException();
        }

        public byte[] AgvTransReady(int DockNum)
        {
            throw new NotImplementedException();
        }


        /// <summary>
        /// 解析设备发过来的数据，只负责解析
        /// </summary>
        /// <param name="IP"></param>
        /// <param name="Data"></param>
        /// <returns></returns>
        public DeviceReceiveData? ResolveData(string IP,byte[] Data)
        {

            //不同的设备有不同的解析方式
            DeviceReceiveData receiveData = new DeviceReceiveData()
            {
                IP=IP,
                Raw= Data,
                InNum=10,
                OutNum=10,
                DockNum = 1, 
                Cmd= DeviceCmdEnum.物料信息,
            };
            return receiveData;
        }

        
    }
}
